load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ddl",
    srcs = [
        "ddl.go",
        "drop_partition.go",
        "exchange_partition.go",
        "reorganize_partition.go",
        "subscriber.go",
        "truncate_partition.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/statistics/handle/ddl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ddl/notifier",
        "//pkg/infoschema",
        "//pkg/meta/model",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/statistics/handle/history",
        "//pkg/statistics/handle/lockstats",
        "//pkg/statistics/handle/logutil",
        "//pkg/statistics/handle/storage",
        "//pkg/statistics/handle/types",
        "//pkg/statistics/handle/util",
        "//pkg/util/intest",
        "@com_github_pingcap_errors//:errors",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "ddl_test",
    timeout = "short",
    srcs = ["ddl_test.go"],
    flaky = True,
    shard_count = 19,
    deps = [
        ":ddl",
        "//pkg/ddl/notifier",
        "//pkg/meta/model",
        "//pkg/parser/model",
        "//pkg/planner/cardinality",
        "//pkg/statistics/handle/storage",
        "//pkg/statistics/handle/util",
        "//pkg/testkit",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/mock",
        "@com_github_stretchr_testify//require",
    ],
)
